package com.bestom.communication.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @author shulman
 */
public class DbHelper extends SQLiteOpenHelper {

    public static final String DATABASE_NAME = "data.db";
    //订阅记录表
    public static final String SUBSCRIBE_NAME = "subscribe_record";
    //推送记录表
    public static final String PUBLISH_NAME = "publish_record";

    private static final int DATABASE_VERSION = 1;

    public DbHelper(Context context){
        super(context,DATABASE_NAME,null,DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + SUBSCRIBE_NAME +
                "( _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                "topic varchar" +
                ") ");

        sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + PUBLISH_NAME +
                "( _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                "topic varchar" +
                ") ");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
